<?php if ($teaser): ?>
<div id="node-<?php print $node->nid; ?>" class="widget node<?php if (!is_null($node->expired) && $node->notification === true) echo ' expired'; ?><?php if (!$status) { print ' node-unpublished'; } ?>">
	   
   <div class="widgetTop"></div>
   
   <div class="widgetMidGrid">
   		<div class="widgetMidPad">
   		   <?php if ($icon): ?>
   		   <div class="widgetColLeft">
   		   <?php echo l("<img class=\"widgetIcon\" src=".base_path().$icon->images['_original']."></img>", $node->next_nid ? 'node/'.$node->nid : 'series/'.$series_term, array(), NULL, NULL, FALSE, TRUE); ?>
   		   </div>
   		   <?php endif; ?>
            <div class="widgetCol<?php if ($icon): echo 'Right'; else: echo 'Full'; endif; ?>">
            	<div class="widgetValue"><?php echo l($node->field_dashboard_sv_value[0]['value'], $node->next_nid ? 'node/'.$node->nid : 'series/'.$series_term); ?></div>
                <div class="widgetUnit"><?php echo $node->field_dashboard_sv_unit[0]['value']; ?></div>
                <div class="clear"></div>
                <h3><?php echo $node->title; ?></h3>
                <p><?php echo $node->field_dashboard_sv_teaser[0]['value']; ?></p>
            </div>
            <div class="clear"></div>
   		</div>
   </div>
   
   <div class="widgetInfoBar">

   <div class="updated"><p><?php echo date('M j, Y', $node->created); ?></p></div>
   <div class="more"><?php echo l(t('More'), $node->next_nid ? 'node/'.$node->nid : 'series/'.$series_term); ?></div>
	
   </div>
	
</div>

<?php else: ?>

<div id="node-<?php print $node->nid; ?>" class="full-widget node<?php if (!is_null($node->expired) && $node->notification === true) echo ' expired'; ?><?php if (!$status) { print ' node-unpublished'; } ?>">

   <div class="full-widgetTop"></div>

   <div class="full-widgetMidGrid">
   		<div class="full-widgetMidPad">
   			<?php if ($icon): ?>
            <img class="widgetIcon" src="<?php echo base_path() . $icon->images['_original']; ?>"></img>
            <?php endif; ?>
            <div class="full-widgetValue"><?php echo $node->field_dashboard_sv_value[0]['value']; ?></div>
            <div class="full-widgetUnit"><?php echo $node->field_dashboard_sv_unit[0]['value']; ?></div><br /><br /><br /><br />
            <h3><?php echo $node->title; ?></h3>
            <p><?php echo $node->field_dashboard_sv_teaser[0]['value']; ?></p>
            <div class="clear"></div>
   		</div>

		<script type="text/javascript">
			$(document).ready(function() {
				$('table.dashboard-gv-table').tablesorter();
			});
		</script>
		<table class="dashboard-gv-table">
	    <?php $rows = explode("\n", $node->field_dashboard_gv_value[0]['value']); ?>
		
		<?php if (trim($rows[0])): ?>
		<thead><tr>
		<?php foreach (explode("\t", trim($rows[0])) as $val): ?>
		  <th><?php echo trim($val); ?></th>
		<?php endforeach; ?>
		</tr></thead>
		<?php endif; ?>

		<tbody>
		<?php $idx = 0; foreach (array_slice($rows, 1) as $row): if (strlen(trim($row)) > 0): ?>
		<tr class="<?php if ($idx % 2): echo 'even'; else: echo 'odd'; endif; $idx++; ?>">
		<?php foreach (explode("\t", trim($row)) as $val): ?>
		  <td><?php echo trim($val); ?></td>
		<?php endforeach; ?>
		</tr>
		<?php endif; endforeach; ?>
		</tbody>
        </table>

		<div class="full-widgetBody">
	        <?php echo $node->body; ?>
	    </div>
   </div>

   <div class="full-widgetInfoBar">
     <div class="updated"><p><?php echo date('M j, Y', $node->created); ?></p></div>
	 <div class="widget-links"><p><?php echo $links; ?></p></div>
   </div>

</div>

<div class="clear"></div>

<?php endif; ?>
